package base.Day05.Exercise;

public class Exercise
{
    public static void main(String[] args)
    {
        Exercise exercise = new Exercise();
        int[] arr1 = new int[]{1,34,5,6,7,8,90,2,3,45,6,7};
        int max= exercise.getMaxOfArray(arr1);
        System.out.println(max);
        exercise.printArrayData(arr1);
    }

    int getMaxOfArray(int[] arr)
    {
        int max = arr[0];
        for (int i = 1 ; i  < arr.length; i++)
        {
            max  = Math.max(max,arr[i]);
        }
        return max;
    }

    void printArrayData(int[] arr)
    {
        for (int j : arr)
        {
            System.out.print(j + "\t");
        }
        System.out.println();
    }

}
